<!--
*@description boss列表
*@fileName bossList.vue
*@author huangyu
*@date 2024/05/16 11:44:10
!-->
<template>
    <div>
        <el-button type="primary" @click="clickTime">新建时间表</el-button>

        <el-button type="primary" @click="clickBoss">新建boss</el-button>

        <el-dialog title="添加时间表" :visible.sync="dialogTime" width="550px">
            <el-form label-width="150px">
                <el-form-item label="标题名称：">
                    <el-input v-model="form.cTitle" placeholder="例: 东方诛仙boss记录时间表"></el-input>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" @click="submitTime">保存</el-button>
                </el-form-item>
            </el-form>
        </el-dialog>

        <el-dialog title="添加Boss" :visible.sync="dialogBoss" width="550px">
            <el-form label-width="150px">
                <el-form-item label="boss线路和名称: ">
                    <el-input v-model="form.cName" placeholder="例:2线昆仑奴"></el-input>
                </el-form-item>
                <el-form-item label="刷新周期：">
                    <el-input v-model="form.cRefreshTime"></el-input>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" @click="submitTime">保存</el-button>
                </el-form-item>
            </el-form>
        </el-dialog>

        <el-dialog title="请先登录" :visible.sync="dialogLogin" width="450px" v-dialogDrag>
            <vLogin @onLogin="onLogin"></vLogin>
        </el-dialog>
    </div>
</template>

<script>
import vLogin from '@/page/game/zhuxian/login.vue'
export default {
    props: {},
    components: {vLogin},
    data () {
        return {
            dialogTime: false,
            dialogBossInfo: false,
            dialogLogin: false,
            cTypeVal: 1,
            token: this.$store.state.token,
            nowDate: new Date().getTime(),
            form: {
                cTitle: "东方诛仙boss记录时间表",//标题名称
                cName: "",//boss名称
                cCloseTime: 0,//到期时间
                cRefreshTime: 8,// bosss刷新间隔
                cTongBuCode: 0,//同步码
                cStatus: 1,
                cBId: "",//房间id
                cUserId: "",
                cType: 1,//1房间类型，2boss类型
            }
        }
    },
    mounted () {

    },
    methods: {
        clickTime(){
            if(this.token){
                this.form.cType = 1
                this.dialogTime = true
            }else{
                this.dialogLogin = true
            }
        },
        submitTime(){
            let params = {
                cUserId: this.token,
                cTitle: this.form.cTitle,
                cType: 1,
                cTT: this.nowDate,
                cTongBuCode: String(this.nowDate).slice(-6),
            }
            console.log(params)
        },
        onLogin(){
            this.dialogLogin = false
            this.$router.go(0)
        },
    },
    watch: {},
}
</script>

<style lang='less' scoped>

</style>
